<template>
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <!-- 查询区域-END -->
    <!-- 操作按钮区域 -->
    <div class="table-operator">
      <a-button type="primary" v-show="activeKey=='cg'" @click="addNotice" icon="plus" style="margin-left: 8px">添加入库通知单</a-button>
      <a-button @click="handleAdd" v-show="activeKey=='rk'" type="primary" icon="plus">新增</a-button>
      <a-button type="primary" icon="download" @click="handleExportXls('入库通知单')">导出</a-button>
<!--      <a-button type="primary" icon="download" @click="alert('打印预览')">打印预览</a-button>-->
<!--      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">-->
<!--        <a-button type="primary" icon="import">导入</a-button>-->
<!--      </a-upload>-->
<!--      <a-button type="primary" @click="reverseCheck">-->
<!--        <a-icon type="close" /> 撤销审核-->
<!--      </a-button>-->
      <!-- 高级查询区域 -->
      <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
      <a-dropdown v-if="selectedRowKeys.length > 0">
        <a-menu slot="overlay">
          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
        </a-menu>
        <a-button style='margin-left: 8px'> 批量操作
          <a-icon type='down' />
        </a-button>
      </a-dropdown>
    </div>

    <a-tabs v-model="activeKey">
      <a-tab-pane key="cg" tab="采购订单">
        <div>
          <div class='table-page-search-wrapper'>
            <a-form layout='inline' @keyup.enter.native='searchQuery'>
              <a-row :gutter='24'>
                <a-col :xl='6' :lg='7' :md='8' :sm='24'>
                  <a-form-item label=''>
                    <a-input v-model="ext" :allow-clear="true"></a-input>
                  </a-form-item>
                </a-col>
                <a-col :xl="6" :lg="7" :md="8" :sm="24">
                  <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
                    <a-button type="primary" @click="searchQueryTab1" icon="search">搜索</a-button>
                  </span>
                </a-col>
              </a-row>
            </a-form>
          </div>
          <a-table
            ref='procTable'
            size='middle'
            bordered
            rowKey='id'
            class='j-table-force-nowrap'
            :scroll='{x:true}'
            :columns='table1.columns'
            :dataSource='table1.dataSource'
            :pagination='table1.ipagination'
            :loading='table1.loading'
            :rowSelection='{selectedRowKeys: table1.selectedRowKeys, onChange: onSelectChangeTab1}'
          >
            <template slot='htmlSlot' slot-scope='text'>
              <div v-html='text'></div>
            </template>
          </a-table>
        </div>
      </a-tab-pane>
      <a-tab-pane key='rk' tab='入库通知单' force-render>
        <div class="table-page-search-wrapper">
          <a-form layout="inline" @keyup.enter.native="searchQuery">
            <a-row >
              <a-col :xl="3" :lg="2" :md="2" :sm="2">
                <a-form-item label="">
                  <a-radio-group v-model="queryParam.status" @change="onRadioChange">
<!--                <a-radio :value="0">待提交</a-radio>-->
<!--                <a-radio :value="1">审批中</a-radio>-->
                    <a-radio :value="2">需修改</a-radio>
                    <a-radio :value="3">已审批</a-radio>
<!--                <a-radio :value="4">已入库</a-radio>-->
                  </a-radio-group>
                </a-form-item>
              </a-col>
              <a-col :xl="4" :lg="6" :md="6" :sm="6">
                <a-form-item label="起始日期">
                  <a-date-picker type="ge" v-model="queryParam.createTime_begin" :format="dateFormat" :valueFormat="dateFormat" @change="changeDate"/>
                </a-form-item>
              </a-col>
              <a-col :xl="4" :lg="7" :md="8" :sm="24">
                <a-form-item label="截止日期">
                  <a-date-picker type="le" v-model="queryParam.createTime_end"  :format="dateFormat" :valueFormat="dateFormat" @change="changeDate"/>
                </a-form-item>
              </a-col>
              <a-col :xl="4" :lg="7" :md="8" :sm="24">
                <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
                  <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
                  <!-- <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>-->
                  <!-- <a @click="handleToggleSearch" style="margin-left: 8px">-->
                  <!-- {{ toggleSearchStatus ? '收起' : '展开' }}-->
                  <!-- <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>-->
                  <!-- </a>-->
                </span>
              </a-col>
            </a-row>
          </a-form>
        </div>
        <div>
          <div class='table-page-search-wrapper'>
            <a-form layout='inline' @keyup.enter.native='searchQuery'>
              <a-row :gutter='24'>
                <a-col :xl='6' :lg='7' :md='8' :sm='24'>
                  <a-form-item label=''>
                    <a-input v-model='ext1'></a-input>
                  </a-form-item>
                </a-col>
                <a-col :xl='6' :lg='7' :md='8' :sm='24'>
                  <span style='float: left;overflow: hidden;' class='table-page-search-submitButtons'>
                    <a-button type='primary' @click='searchQueryTab' icon='search'>搜索</a-button>
                  </span>
                </a-col>
              </a-row>
            </a-form>
          </div>
        </div>
        <div>
          <div class='ant-alert ant-alert-info' style='margin-bottom: 16px;'>
            <i class='anticon anticon-info-circle ant-alert-icon'></i> 已选择 <a
            style='font-weight: 600'>{{ selectedRowKeys.length }}</a>项
            <a style='margin-left: 24px' @click='onClearSelected'>清空</a>
            <a-popover title='自定义列' trigger='click' placement='leftBottom' style='float: right'>
              <template slot='content'>
                <a-checkbox-group @change='onColSettingsChange' v-model='settingColumns' :defaultValue='settingColumns'>
                  <a-row>
                    <template v-for='(item,index) in defColumns'>
                      <template v-if="item.key!='rowIndex'&& item.dataIndex!='action'">
                        <a-col :span='12'>
                          <a-checkbox :value='item.dataIndex'>{{ item.title }}</a-checkbox>
                        </a-col>
                      </template>
                    </template>
                  </a-row>
                </a-checkbox-group>
              </template>
              <a><a-icon type='setting' />自定义列</a>
            </a-popover>
          </div>
          <a-table
            ref='table'
            size='middle'
            bordered
            :rowKey="(record,index)=>{return record.detailId}"
            class="j-table-force-nowrap"
            :columns="columns"
            :dataSource="dataSource"
            :pagination="ipagination"
            :loading="loading"
            :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
            @change="handleTableChange"
            :rowClassName="(record, index) => (record.disuse === 1 ? 'gray-row' : null)"
            :customRow='rowProperties'
            :scroll="{x:true}"
          >
            <template slot='htmlSlot' slot-scope='text'>
              <div v-html='text'></div>
            </template>
          </a-table>
        </div>
      </a-tab-pane>
    </a-tabs>
    <!-- table区域-begin -->
    <buss-storage-notice-modal ref='modalForm' @ok='modalFormOk' />
  </a-card>
</template>

<script>
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import BussStorageNoticeModal from './modules/BussStorageNoticeModal'
  import '@/assets/less/TableExpand.less'
  // import { getDictItems } from '@comp/dict/JDictSelectUtil'
  import { filterDictTextByCache, filterMultiDictText, getDictItems } from '@/components/dict/JDictSelectUtil'
  import { deleteAction, getAction } from '@api/manage'
  import { filterObj } from '@/utils/util'
  import ActApplyBtn from '@views/flowable/components/ActApplyBtn.vue'
  import ActHistoricDetailBtn from '@views/flowable/components/ActHistoricDetailBtn.vue'
  import ActCancelBtn from "@views/flowable/components/ActCancelBtn";
  import ActHandleBtn from "@views/flowable/components/ActHandleBtn";
  import moment from 'dayjs'

export default {
  name: 'BussStorageNoticeList',
  mixins: [JeecgListMixin],
  components: {
    ActHistoricDetailBtn, ActApplyBtn,
    BussStorageNoticeModal,
    ActCancelBtn,
    ActHandleBtn
  },
  data() {
    return {
      moment,
      disableMixinCreated: true,
      dateFormat: 'YYYY-MM-DD',
      //moment(JSON.parse(item.afterContent).updateTime).format('YYYY-MM-DD HH:mm:ss')
      dict: {
        rkType: [],
        unit: []
      },
      queryParam:{
        status: 3
      },
      pcaData: '',
      serviceName: 'bussStorageNoticeServiceImpl',
      description: '入库通知单管理页面',
      ext: '',
      ext1: '',
      activeKey: 'rk',
      table1: {
        selectedRowKeys: [],
        selectionRows: [],
        loading: false,
        columns: [
          {
            title: '#',
            dataIndex: '',
            key: 'rowIndex',
            width: 60,
            align: 'center',
            customRender: function(t, r, index) {
              return parseInt(index) + 1
            }
          },
          {
            title: '编号',
            align: 'center',
            dataIndex: 'code',
            scopedSlots: { customRender: 'htmlSlot' }
          },
          {
            title: '物料编号',
            align: 'center',
            dataIndex: 'materialCode',
            scopedSlots: { customRender: 'htmlSlot' }
          },
          {
            title: '物料名称',
            align: 'center',
            dataIndex: 'materialName',
            scopedSlots: { customRender: 'htmlSlot' }
          },
          {
            title: '规格',
            align: 'center',
            dataIndex: 'spec',
            scopedSlots: { customRender: 'htmlSlot' }
          },
          {
            title: '订单数量',
            align: 'center',
            dataIndex: 'procurementNum',
            scopedSlots: { customRender: 'htmlSlot' }
          },
          {
            title:'已到货数量',
            align:"center",
            dataIndex: 'arrivalNum',
            scopedSlots: { customRender: 'htmlSlot' },
          },
          {
            title: '未到货数量',
            align: 'center',
            dataIndex: 'originalNum',
            // scopedSlots: { customRender: 'htmlSlot' },
            customRender: (text, record, index) => {
              // Provide default value if baseValue is missing
              if(record.arrivalNum){
                return record.procurementNum - record.arrivalNum;
              }
              return record.procurementNum;
            }
          },
          {
            title: '价格',
            align: 'center',
            dataIndex: 'procurementArrayPrice',
            scopedSlots: { customRender: 'htmlSlot' }
          },
          {
            title: '制单人',
            align: 'center',
            dataIndex: 'createBy',
            scopedSlots: { customRender: 'htmlSlot' }
          },
          {
            title: '制单日期',
            align: 'center',
            dataIndex: 'createTime'
            , scopedSlots: { customRender: 'htmlSlot' }
          },
          {
            title: '制单部门',
            align: 'center',
            dataIndex: 'sysOrgCode',
            scopedSlots: { customRender: 'htmlSlot' }
          },
          {
            title: '供方单位',
            align: 'center',
            dataIndex: 'supplierName',
            scopedSlots: { customRender: 'htmlSlot' }
          }

        ],
        dataSource: [],
        dataSourceBack: [],
        ipagination: {
          current: 1,
          pageSize: 30,
          pageSizeOptions: ['10', '20', '30'],
          showTotal: (total, range) => {
            return range[0] + '-' + range[1] + ' 共' + total + '条'
          },
          showQuickJumper: true,
          showSizeChanger: true,
          total: 0
        }
      },
      isorter: {
        column: 'id',
        order: 'desc',
      },
      // 表头
      columns: [],
      settingColumns: [],
      // 表头
      defColumns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          width: 60,
          align: 'center',
          customRender: function(t, r, index) {
            return parseInt(index) + 1
          }
        },
        {
          title: '编号',
          align: 'center',
          dataIndex: 'code',
          scopedSlots: { customRender: 'htmlSlot' }
        },
        {
          title: '供应商',
          align: 'center',
          dataIndex: 'supplierName',
          scopedSlots: { customRender: 'htmlSlot' }
        },
        {
          title: '批次号',
          align: 'center',
          dataIndex: 'lotNumber',
          scopedSlots: { customRender: 'htmlSlot' }
        },
        {
          title: '原料编号',
          align: 'center',
          dataIndex: 'materialCode',
          scopedSlots: { customRender: 'htmlSlot' }
        },
        {
          title: '原料名称',
          align: 'center',
          dataIndex: 'materialName'
          , scopedSlots: { customRender: 'htmlSlot' }
        },
        {
          title: '规格',
          align: 'center',
          dataIndex: 'spec',
          scopedSlots: { customRender: 'htmlSlot' }
        },
        {
          title: '单位',
          align: 'center',
          dataIndex: 'unit_dict',
          scopedSlots: { customRender: 'htmlSlot' }
        },
        {
          title: '采购数量',
          align: 'center',
          dataIndex: 'procurementNum',
          scopedSlots: { customRender: 'htmlSlot' }
        },
        {
          title: '实收数量',
          align: 'center',
          dataIndex: 'actualNum',
          scopedSlots: { customRender: 'htmlSlot' }
        },
        {
          title: '制单日期',
          align: 'center',
          dataIndex: 'createTime',
          scopedSlots: { customRender: 'htmlSlot' }
        },
        {
          title: '制单人',
          align: 'center',
          dataIndex: 'createBy',
          scopedSlots: { customRender: 'htmlSlot' }
        },
        {
          title: '进厂日期',
          align: 'center',
          dataIndex: 'factoryTime',
          scopedSlots: { customRender: 'htmlSlot' }
        },
        {
          title: '生产日期',
          align: 'center',
          dataIndex: 'createDate',
          scopedSlots: { customRender: 'htmlSlot' }
        },
        {
          title: '限用日期',
          align: 'center',
          dataIndex: 'expiryDate',
          scopedSlots: { customRender: 'htmlSlot' }
        },
        // {
        //   title:'让步接受数量-',
        //   align:"center",
        //   dataIndex: '',
        //   scopedSlots: { customRender: 'htmlSlot' },
        // },
        // {
        //   title:'入库数量-',
        //   align:"center",
        //   dataIndex: '',
        //   scopedSlots: { customRender: 'htmlSlot' },
        // },
        {
          title: '物料批号',
          align: 'center',
          dataIndex: 'materialLotNum',
          scopedSlots: { customRender: 'htmlSlot' }
        },
        {
          title: '库位',
          align: 'center',
          dataIndex: 'erpLocationName',
          scopedSlots: { customRender: 'htmlSlot' }
        },
        {
          title: '宝洁供应商编号',
          align: 'center',
          dataIndex: 'bjSupplierCode',
          scopedSlots: { customRender: 'htmlSlot' }
        },
        {
          title: '宝洁供应商采购订单号',
          align: 'center',
          dataIndex: 'bjProcurementCode',
          scopedSlots: { customRender: 'htmlSlot' }
        },
        {
          title: '宝洁供应商名称',
          align: 'center',
          dataIndex: 'bjSupplierName',
          scopedSlots: { customRender: 'htmlSlot' }
        },
        {
          title: '流程状态',
          align: 'center',
          dataIndex: 'actStatus',
          scopedSlots: { customRender: 'htmlSlot' }
        },
        {
          title: '待处理节点',
          align: 'center',
          dataIndex: 'todoUsers',
          scopedSlots: { customRender: 'htmlSlot' }
        },
        // {
        //   title:'处理人',
        //   align:"center",
        //   dataIndex: 'todoUsers'
        // },
        {
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          fixed: 'right',
          width: 400,
          customRender: (text, record, index) => {
            const obj = {
              children: [
                //record.status === 0 || record.status === 2
                (record.status === 0 || record.status === 2) && (
                  <a onClick={() => this.handleEdit(record)}>编辑</a>
                ),
                (record.status === 0 || record.status === 2)  && (
                  <a-divider type='vertical'></a-divider>
                ),
                (record.status === 0 || record.status === 2) &&(  <act-apply-btn
                  onSuccess={() => this.loadData(record.id)} // 绑定成功事件
                  data-id={record.id} // 设置 data-id 属性
                  serviceName={this.serviceName} // 设置 serviceName 属性（假设变量已定义）
                  variables={record} // 设置 variables 属性，传递整个 record 对象
                />),
                <act-historic-detail-btn data-id={record.id}></act-historic-detail-btn>,
                <a-divider type='vertical' />,
                <a-dropdown>
                  <a class='ant-dropdown-link'>更多 <a-icon type='down' /></a>
                  <a-menu slot='overlay'>
                    <a-menu-item>
                      <a onClick={() => this.handleDetail(record)}>详情</a>
                    </a-menu-item>
                    <a-menu-item>
                      <a-popconfirm title='确定删除吗?' onConfirm={() => this.handleDelete(record.detailId)}>
                        <a>删除</a>
                      </a-popconfirm>
                    </a-menu-item>
                  </a-menu>
                </a-dropdown>
              ],
              attrs: {}
            }
            // // 判断是否需要合并行
            // if (index > 0 && record.id === this.dataSource[index - 1].id) {
            //   obj.attrs.rowSpan = 0
            // } else {
            //   obj.attrs.rowSpan = this.dataSource.filter(item => item.id === record.id).length
            // }
            return obj
          }
          // scopedSlots: { customRender: 'action' },
        }
      ],
      url: {
        list: '/business/bussStorageNotice/list',
        delete: '/business/bussStorageNotice/delete',
        deleteBatch: '/business/bussStorageNotice/deleteBatch',
        exportXlsUrl: '/business/bussStorageNotice/exportXls',
        importExcelUrl: 'business/bussStorageNotice/importExcel',
        proclist: '/business/bussMaterialProcurement/page/list'
      },
      dictOptions: {},
      superFieldList: []
    }
  },
  created() {
    this.columns = this.defColumns
    this.getSuperFieldList()
    // getDictItems('rk_type').then(res=>{
    //   this.dict.rkType = res
    // });
    // getDictItems('zl_unit').then(res=>{
    //   this.dict.unit = res
    // });
    this.loadProcData()
    this.queryParam.createTime_begin = moment().subtract(7, 'days').format(this.dateFormat)
    this.queryParam.createTime_end = moment().format(this.dateFormat)
    this.loadData();
    //初始化字典配置 在自己页面定义
    this.initDictConfig();
  },
  computed: {
    importExcelUrl: function() {
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
    },
    mappeddDataSource() {
      return this.dataSource.map(data => ({
        ...data,
        type_dictText: data.type ? this.dict.rkType[data.type].label : ''
        // unit_dict: data.unit?this.dict.unit[data.unit].label:""
        // statusText: statusDict[data.status]
      }))
    }
  },
  methods: {
    onRadioChange() {
      this.loadData()
    },
    changeDate() {
      this.$forceUpdate()
    },
    onCustomRow(record) {
      return {
        onClick: () => {
          console.log('单击行:', record) // 验证方法是否被调用
          // 这里添加您的单击行处理逻辑
        }
      }
    },
    rowProperties(record, index) {
      return {
        on: {
          click: (event) => {
            // alert(888888)
          }
        }
        // onClick: (event) => {
        //   alert(888888)
        // },
      }
    },
    reverseCheck() {
      if (this.selectionRows.length < 1) {
        this.$message.error('请选择后再进行撤销审核操作')
        return
      }
      if (this.selectionRows.length > 1) {
        this.$message.error('撤销审核最多只能选择一条记录')
        return
      }
      getAction('/business/bussStorageNotice/reverseCheck', { id: this.selectionRows[0].id }).then(res => {
        if (res.success) {
          this.$message.success(res.message)
          this.loadData()
        } else {
          this.$message.error(res.message)
        }
      })

    },
    relationAct(r) {
      getAction('/business/bussStorageNotice/relationAct', { dataId: r.id }).then(res => {
        if (res.success) {
          this.$message.success('操作成功')
          this.loadData()
        } else {
          this.$message.error('操作失败')
        }
      })
    },
    handleDelete: function (id) {
      if (!this.url.delete) {
        this.$message.error("请设置url.delete属性!")
        return
      }
      var that = this;
      deleteAction(that.url.delete, {id: id}).then((res) => {
        if (res.success) {
          //重新计算分页问题
          that.reCalculatePage(1)
          that.$message.success(res.message);
          that.loadData();
        } else {
          that.$message.warning(res.message);
        }
      });
    },
    searchQueryTab1(){
      let searchVar = this.ext
      if(!searchVar){
        this.loadProcData()
      }
    },
    searchQueryTab() {
      this.dataSource = this.dataSourceBack
      let searchVar = this.ext1
      let newDataSource = []
      if (searchVar && searchVar != '') {
        this.dataSource.forEach(obj => {
          let newObj = {}
          let shouldAdd = false
          Object.keys(obj).forEach(key => {
            if (typeof obj[key] === 'string' && obj[key].includes(searchVar)) {
              newObj[key] = obj[key].replace(new RegExp(`(${searchVar})`, 'g'), '<span class="highlight">$1</span>')
              shouldAdd = true // Set flag to true if any property meets criteria
            } else {
              newObj[key] = obj[key]
            }
          })
          if (shouldAdd) {
            newDataSource.push(newObj)
          }
        })
        this.dataSource = newDataSource
      }
    },
    getProcQueryParams() {
      //获取查询条件
      var param = {};
      var param = Object.assign({}, {}, {}, {});
      console.log('canshu',param)
      param.field = this.getTable1QueryField();
      param.ext = this.ext
      param.pageNo = this.table1.ipagination.current;
      param.pageSize = this.table1.ipagination.pageSize;
      param.status = '0,2'
      return filterObj(param);
    },
    getTable1QueryField() {
      //TODO 字段权限控制
      var str = "id,";
      this.table1.columns.forEach(function (value) {
        str += "," + value.dataIndex;
      });
      return str;
    },
    loadProcData() {
      //加载数据 若传入参数1则加载第一页的内容
      // if (arg === 1) {
      //   this.ipagination.current = 1;
      // }
      // var params = {}
      var params = this.getProcQueryParams()//查询条件
      this.table1.loading = true
      getAction(this.url.proclist, params).then((res) => {
        if (res.success) {
          //update-begin---author:zhangyafei    Date:20201118  for：适配不分页的数据列表------------
          this.table1.dataSource = res.result.records || res.result
          if (res.result.total) {
            this.table1.ipagination.total = res.result.total
          } else {
            this.table1.ipagination.total = 0
          }
          //update-end---author:zhangyafei    Date:20201118  for：适配不分页的数据列表------------
        } else {
          this.$message.warning(res.message)
        }
      }).finally(() => {
        this.table1.loading = false
      })
    },
    onSelectChangeTab1(selectedRowKeys, selectionRows) {
      this.table1.selectedRowKeys = selectedRowKeys
      this.table1.selectionRows = selectionRows
    },
    addNotice() {
      const rows = this.table1.selectionRows
      if (rows.length == 0) {
        this.$message.warn('请选择采购单！')
        return
      }
      const supplierId = rows[0].supplierId
      const newrows = rows.filter(item => item.supplierId === supplierId)
      if (newrows.length != rows.length) {
        this.$message.warn('一个入库通知单单只能是同一个供应商！')
        return
      }
      //
      this.$refs.modalForm.add()
      this.$refs.modalForm.title = '新增'
      this.$refs.modalForm.disableSubmit = false
      // 添加入库通知单
      this.$nextTick(() => {
        this.$refs.modalForm.$refs.realForm.procSelectRows = rows
        this.$refs.modalForm.$refs.realForm.addProc()
      })
    },

    batchDel: function() {
      if (!this.url.deleteBatch) {
        this.$message.error('请设置url.deleteBatch属性!')
        return
      }
      if (this.selectedRowKeys.length <= 0) {
        this.$message.warning('请选择一条记录！')
        return
      } else {
        var ids = ''
        for (var a = 0; a < this.selectedRowKeys.length; a++) {
          ids += this.selectionRows[a].detailId + ','
        }
        var that = this
        this.$confirm({
          title: '确认删除',
          content: '是否删除选中数据?',
          onOk: function() {
            that.loading = true
            deleteAction(that.url.deleteBatch, { ids: ids }).then((res) => {
              if (res.success) {
                //重新计算分页问题
                that.reCalculatePage(that.selectedRowKeys.length)
                that.$message.success(res.message)
                that.loadData()
                that.onClearSelected()
              } else {
                that.$message.warning(res.message)
              }
            }).finally(() => {
              that.loading = false
            })
          }
        })
      }
    },
    initDictConfig() {
    },

    getSuperFieldList() {
      let fieldList = []
      fieldList.push({ type: 'string', value: 'code', text: '单据编号', dictCode: '' })
      fieldList.push({ type: 'string', value: 'type', text: '单据类型', dictCode: '' })
      fieldList.push({ type: 'string', value: 'lotNumber', text: '批次号', dictCode: '' })
      fieldList.push({ type: 'datetime', value: 'factoryTime', text: '进场日期' })
      fieldList.push({ type: 'string', value: 'venderId', text: '供应商', dictCode: '' })
      fieldList.push({ type: 'string', value: 'procurementId', text: '采购id', dictCode: '' })
      this.superFieldList = fieldList
    }
  }
}
</script>
<style>
.highlight {
  color: red;
}

@import '~@assets/less/common.less';
.gray-row {
  /*color: gray;*/
  /*background-color: #f2f2f2; !* 灰色背景 *!*/
}

.ant-table-tbody :deep(.table-striped) td {
  background-color: #fafafa;
}
</style>